package com.wedo.book.api;

import com.wedo.book.pojo.Book;
import com.wedo.common.pojo.PageResult;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@RequestMapping("books")
public interface BookApi {

    @GetMapping("page")
    public PageResult<Book> queryBookByPage(
            @RequestParam(value = "title",required = false) String title,
            @RequestParam(value = "page",defaultValue = "1") Integer page,
            @RequestParam(value = "rows",defaultValue = "6") Integer rows
    );

    @GetMapping("bid/{bid}")
    public Book queryBookByBid(@PathVariable("bid")Long bid);
}
